<?php 
class Application{
	protected $session = NUll;
	
	function __construct($session) {
		$this->session = $session;
	}
	function direct() {
      if ($this->session != NULL) {
      	include 'homepage.php';
      	;
      }
      else{
      	include 'login.php';
      }
	}
	
}
$application = new Application($_SESSION["userid"]);
$application->direct();
?>
